home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr18 / mrun210.zip / MRUN210A.WAS < prev    next >
Text File  |  1993-04-28  |  23KB  |  701 lines

  1. ;MailRun v2.10:  Part A, Main body of script
  2. ;1992-1993 Gerald P. Sully, all rights reserved.
  3.  
  4. #comment
  5. **************************************************************************
  6. **************************************************************************
  7. * This file serves as "home base" for the rest of the script.
  8. * All other scripts will return to this one if they are
  9. * exited normally.  It initializes MailRun, creates the
  10. * user interface, and then waits for action on the part of the
  11. * user.  If the user executes a mailrun, this section is also
  12. * responsible for taking care of scheduling.
  13. * Elements of the user interface are contained in the header
  14. * file (MRUN210.H).  Menu selections are fielded by parsemenu()
  15. * and the toolbar is controlled by parseobject().  The routines 
  16. * associated with menu items are contained in the header file 
  17. * immediately following parsemenu() and parseobject().  Some of
  18. * these in turn call routines in other script modules through 
  19. * the callscript() procedure.  Where necessary, a FLAG is set to
  20. * inform the target module which routines to execute.  
  21. * The code for the interface is #included in every module of 
  22. * MailRun so that any part of the script may be called from any 
  23. * other part.  Other script modules are called by MRUN210A and 
  24. * MRUN210G (the module responsible for executing the mailrun) 
  25. * using the "execute" command.  When a module is called from
  26. * MRUN210B-F, a "chain" command is used.
  27. **************************************************************************
  28. **************************************************************************
  29. #endcomment
  30.  
  31. #define MRUN210A
  32. #define MRUN210AG
  33. #define MRUN210AB
  34.  
  35. string MainBoxTabs
  36. integer RingInterrupt, AutoRun
  37. integer MailRunMenu, RunningMenu, FileMenu, ConfigMenu, AddMenu
  38. integer DefaultsMenu, ExecuteMenu, HelpMenu, EditMenu
  39.  
  40. #include "mrun210.h"
  41. #define HAVEYOUPAID;YOURFIFTEENDOLLARSYET
  42.  
  43. #comment
  44. *********************************************************************
  45. * MAIN()
  46. * Calls checkchild(), initialize(), maketasklist(),
  47. * makemailrunlist(), runmenu(), mrunmenu(), mrunwin(),
  48. * getfirstitem(), helpabout(), parsedialog(), parsekeystate(),
  49. * interfaceon(), executor(), makefullname()
  50. * Main first calls the initialization routines, then puts
  51. * up the main dialog box and waits for user action.
  52. *********************************************************************
  53. #endcomment
  54.  
  55. proc main
  56. string MRunIcons
  57.     checkchild()
  58.     initialize()
  59.     runmenu()
  60.     mrunmenu()
  61.     mrunwin()
  62.     makemailrunlist()
  63.     maketasklist()
  64.     getfirstitem()
  65.     showmenu MailRunMenu
  66.     if AutoRun == 1
  67.         filereset()
  68.         FLAGS |= RUNNING
  69.         GoWait = 1
  70.         PostRun = 3
  71.         pause 2
  72.     else
  73. #ifdef HAVEYOUPAID;YOURFIFTEENDOLLARSYET
  74.         helpabout()
  75. #else
  76.         mailrunbox()
  77. #endif
  78.     endif
  79.     interfaceon()
  80.     MRunIcons = makefullname(MailRunDir, "MRUNICON.DLL")
  81.     when dialog call parsedialog
  82.     while 1
  83.         if FLAGS & RUNNING
  84.             copyfile MRunIcons "C:\MRUNICON.DLL"
  85.             iconbutton 1 40 0 "" "C:\MRUNICON.DLL" 16 background
  86.             paint
  87.             delfile "C:\MRUNICON.DLL"
  88.              showmenu RunningMenu
  89.              executor()
  90.             copyfile MRunIcons "C:\MRUNICON.DLL"
  91.             iconbutton 1 40 0 "" "C:\MRUNICON.DLL" 0 background
  92.             paint
  93.             delfile "C:\MRUNICON.DLL"
  94.              showmenu MailRunMenu
  95.         endif
  96.     endwhile
  97. endproc
  98.  
  99.  
  100. #comment
  101. *********************************************************************
  102. * INITIALIZE()
  103. * Called by main()
  104. * Calls cleardir(), makemrn(), makefullname(), checkfile()
  105. * Saves system state and initializes global variables.
  106. *********************************************************************
  107. #endcomment
  108.  
  109. proc initialize
  110. string LastRun, env, temp , CleanupFile
  111. string StateCapPath, StateCapFile, StateDnldPath, StateUpldPath
  112. integer StateAutoDL, StateActionBar, StateMetaKeys
  113. integer blank = 0
  114.     ;Create the working directory
  115.     getenv "TEMP" env
  116.     if NULLSTR env
  117.         TempDir = makefullname($PWTASKPATH, "MRUNTEMP")
  118.     else
  119.         TempDir = makefullname(env, "MRUNTEMP")
  120.     endif
  121.     FLAGS = 0
  122.     MailRunIni = makefullname($WINPATH, "MAILRUN.INI")
  123.     profilerd MailRunIni "MailRun" "MailRun" MailRunTrunc
  124.     profilerd MailRunIni "MailRun" "MailRunDir" MailRunDir
  125.     profilerd MailRunIni "MailRun" "AutoRun" AutoRun
  126.  
  127.     ;Save the current state of PCPlus/Win
  128.     fetch autodnld StateAutoDL
  129.     fetch capture path StateCapPath
  130.     fetch capture file StateCapFile
  131.     fetch dnldpath StateDnldPath
  132.     fetch upldpath StateUpldPath
  133.     StateActionBar = $ACTIONBAR
  134.     StateMetaKeys = $METAKEYS
  135.     ;Save the system state in the cleanup file
  136.     cleanupfile = makefullname(TempDir, "CLEANUP.TMP")
  137.     profilewr CleanupFile "Cleanup" "StateAutoDL" StateAutoDL
  138.     profilewr CleanupFile "Cleanup" "StateCapPath" StateCapPath
  139.     profilewr CleanupFile "Cleanup" "StateCapFile" StateCapFile
  140.     profilewr CleanupFile "Cleanup" "StateDnldPath" StateDnldPath
  141.     profilewr CleanupFile "Cleanup" "StateUpldPath" StateupldPath
  142.     profilewr CleanupFile "Cleanup" "StateActionBar" StateActionBar
  143.     profilewr CleanupFile "Cleanup" "StateMetaKeys" StateMetaKeys
  144.  
  145.     ;Change the settings
  146.     set capture path MailRunDir
  147.     set capture query OFF
  148.     set autodnld OFF
  149.     set aspect rangechk OFF
  150.     metakeys OFF
  151.     actionbar OFF
  152.  
  153.     ;If the mailrun in MAILRUN.INI doesn't exist, create it
  154.     if NULLSTR MailRunTrunc
  155.         blank = 1
  156.     else
  157.         LastRun = makefullname(MailRunDir, MailRunTrunc)
  158.     endif
  159.     if !(checkfile(LastRun)) || blank
  160.         temp = makefullname(MailRunDir, "*.MRN")
  161.         findfirst temp
  162.         if FOUND
  163.             MailRunTrunc = $FILENAME
  164.             LastRun = makefullname(MailRunDir, MailRunTrunc)
  165.         else
  166.             MailRunTrunc = "mailrun.mrn"
  167.             MailRunList = "mailrun.mrn"
  168.             makemrn()
  169.             LastRun = MailRun
  170.         endif
  171.     endif
  172.     ;Copy the mailrun to the temp directory
  173.     MailRun = makefullname(TempDir, MailRunTrunc)
  174.     TaskList = makefullname(TempDir, "TASKLIST.TMP")
  175.     copyfile LastRun MailRun
  176.     profilerd MailRun "MailRun" "Archiver" Archiver
  177.     profilerd MailRun "MailRun" "QWKReader" QWKReader
  178.     profilerd MailRun "MailRun" "LogViewer" LogViewer
  179. endproc
  180.  
  181.  
  182. #comment
  183. *********************************************************************
  184. * EXECUTOR()
  185. * Called by main()
  186. * Calls schedulebox(), mailrunbox(), checktime(), fileexit(),
  187. * scheduler(), domailrun(), makefullname(), filereset(),
  188. * maketasklist()
  189. * Executes MRUN210G
  190. * Puts up the MailRun Scheduling box and parses the result.
  191. *********************************************************************
  192. #endcomment
  193.  
  194. proc executor
  195. string HH, MM, SS, temp, LogFile, domailrun
  196. integer Hour, Minute, Second
  197. integer dialogstatus, boxstatus
  198.     domailrun = makefullname(MailRunDir, "MRUN210G")
  199.     findfirst MailRun
  200.     LogFile = $FNAME
  201.     strcat LogFile ".CAP"
  202.     if AppendLog == 0
  203.         ;if user does not want to append to existing log file
  204.         temp = makefullname(MailRunDir, LogFile)
  205.         delfile temp
  206.     endif
  207.     set capture file LogFile
  208.     profilerd MailRun "MailRun" "RingInterrupt" RingInterrupt
  209.     if AutoRun == 0
  210.         profilerd MailRun "MailRun" "ExecTime" ExecTime
  211.         profilerd MailRun "MailRun" "PostRun" PostRun
  212.         profilerd MailRun "MailRun" "GoWait" GoWait
  213.         schedulebox()
  214.         if GoWait == 1 
  215.             disable CTRL 230
  216.         endif
  217.     endif
  218.     ;boxstatus indicates whether or not mailrunbox is showing
  219.     boxstatus = 0
  220.     ;turn off parsedialog() for parsing contols
  221.     clearwhen dialog
  222.     while (FLAGS & RUNNING) && (AutoRun == 0)
  223.         dialogstatus = $DIALOG
  224.         switch dialogstatus
  225.             case 1
  226.                 ;User selected "Cancel"
  227.                 FLAGS &= IDLE
  228.                 mailrunbox()
  229.                 boxstatus = 1
  230.                 ;turn back on parsedialog() for parsing controls
  231.                 when dialog call parsedialog
  232.                 return
  233.             endcase
  234.             case 10
  235.                 ;User selected "OK"
  236.                 if GoWait == 2
  237.                     ;if the scheduler is turned on...
  238.                     ;parse the entered time
  239.                     strextract HH ExecTime ":" 0
  240.                     strextract MM ExecTime ":" 1
  241.                     strextract SS ExecTime ":" 2
  242.                     Hour = checktime(HH)
  243.                     Minute = checktime(MM)
  244.                     Second = checktime(SS)
  245.                     if ((Hour < 0) || (Hour > 23)) || ((Minute < 0) || \
  246.                         (Minute > 59)) || ((Second < 0) || (Second > 59))
  247.                         usermsg "The time must be in 24 hour format!"
  248.                         ExecTime = "HH:MM:SS"
  249.                         updatedlg 128
  250.                         dialogstatus = $DIALOG
  251.                         loopwhile
  252.                     endif
  253.                     profilewr MailRun "MailRun" "ExecTime" ExecTime
  254.                 endif
  255.                 profilewr MailRun "MailRun" "RingInterrupt" RingInterrupt
  256.                 profilewr MailRun "MailRun" "PostRun" PostRun
  257.                 profilewr MailRun "MailRun" "GoWait" GoWait
  258.                 exitwhile
  259.             endcase
  260.             case 50
  261.                 ;User changed Now/Later status
  262.                 if GoWait == 2
  263.                     enable CTRL 230
  264.                 else
  265.                     disable CTRL 230
  266.                 endif
  267.             endcase
  268.         endswitch
  269.     endwhile
  270.     while FLAGS & RUNNING
  271.         if AutoRun == 1
  272.             profilewr MailRunIni "MailRun" "AutoRun" 0
  273.         endif
  274.         if GoWait == 2
  275.             ;if user has scheduled for a later time...
  276.             mailrunbox()
  277.             boxstatus = 1
  278.             disable CTRL 170
  279.             when dialog call parsedialog
  280.             scheduler()
  281.         endif
  282.         if FLAGS & RUNNING
  283.             ;if the user has not terminated the mailrun, execute it
  284.             execute domailrun
  285.             boxstatus = 0
  286.             if PostRun == 2
  287.                 ;if post-mailrun activity is "Restart", reset the mailrun
  288.                 filereset()
  289.             elseif PostRun == 3
  290.                 ;if post-mailrun activity is "Shut Down", do so
  291.                 fileexit()
  292.             else
  293.                 ;if post-mailrun activity is "Remain Idle", reset RUNNING flag
  294.                 FLAGS &= IDLE
  295.             endif
  296.         endif
  297.     endwhile
  298.     if boxstatus == 0
  299.         ;if mailrunbox is not displayed, show it
  300.         mailrunbox()
  301.         when dialog call parsedialog
  302.     endif
  303.     if GoWait == 2
  304.         ;if the scheduler was used, enable the combobox
  305.         enable CTRL 170
  306.     endif
  307.     statmsg ""
  308.     maketasklist()
  309.     updatedlg 80
  310. endproc
  311.  
  312.  
  313. #comment
  314. *********************************************************************
  315. * SCHEDULER()
  316. * Called by executor()
  317. * Waits until the scheduled time before executing the
  318. * mailrun.
  319. *********************************************************************
  320. #endcomment
  321.  
  322. proc scheduler
  323. long LExecTime
  324.     updatedlg 64
  325.     ;get the system time for execution
  326.     strsltime $DATE ExecTime LExecTime
  327.     if LExecTime <= $LTIME
  328.         ;if the time of execution is earlier than the current time
  329.         ;increment the time of execution by 24 hours.
  330.         LExecTime += 86400
  331.     endif
  332.     strupr MailRunTrunc
  333.     while (LExecTime > $LTIME) && (FLAGS & RUNNING)
  334.         ;wait until the designated time is reached
  335.         statmsg "%s will execute at %s       Current time is %s" \
  336.             MailRunTrunc ExecTime $TIME24
  337.         pause 1
  338.     endwhile
  339.     strlwr MailRunTrunc
  340. endproc
  341.  
  342.  
  343. #comment
  344. *********************************************************************
  345. * CHECKTIME()
  346. * Called by executor()
  347. * Converts a string into an integer time value.  Returns
  348. * a value of 60 if a non-numeric character is received.
  349. *********************************************************************
  350. #endcomment
  351.  
  352. func checktime : integer
  353. strparm TimeString
  354. integer TimeInteger
  355.     atoi TimeString TimeInteger
  356.     if TimeInteger == 0
  357.         if not strcmpi TimeString "00"
  358.             TimeInteger = 60
  359.         endif
  360.     endif
  361.     return TimeInteger
  362. endfunc
  363.  
  364.  
  365. #comment
  366. *********************************************************************
  367. * MRUNMENU()
  368. * Called by main()
  369. * Creates the MailRun menu bar.
  370. *********************************************************************
  371. #endcomment
  372.  
  373. proc mrunmenu
  374.     menubar MailRunMenu
  375.         menupopup MailRunMenu "&File" FileMenu
  376.             menuitem FileMenu 1 "&New"
  377.             menuitem FileMenu 2 "&Save"
  378.             menuitem FileMenu 3 "Save &As"
  379.             menuitem FileMenu SEPARATOR
  380.             menuitem FileMenu 4 "&Reset mailrun"
  381.             menuitem FileMenu 5 "&Delete mailrun"
  382.             menuitem FileMenu SEPARATOR
  383.             menuitem FileMenu 6 "&Create AutoRun"
  384.             menuitem FileMenu SEPARATOR
  385.             menuitem FileMenu 7 "E&xit"
  386.         menupopup MailRunMenu "&Edit" EditMenu
  387.             menuitem EditMenu 8 "Cu&t"
  388.             menuitem EditMenu 9 "&Copy"
  389.             menuitem EditMenu 10 "&Paste"
  390.             menuitem EditMenu SEPARATOR
  391.             menuitem EditMenu 11 "De&lete"
  392.         menupopup MailRunMenu "&Configure" ConfigMenu
  393.             menuitem ConfigMenu 12 "&Mailrun Settings"
  394.             menuitem ConfigMenu 13 "&BBS Settings"
  395.             menuitem ConfigMenu 14 "BBS &Prompts"
  396.             menuitem ConfigMenu 15 "BBS Mail &Door"
  397.             menupopup ConfigMenu "De&faults" DefaultsMenu
  398.                 menuitem DefaultsMenu 16 "&MailRun"
  399.                 menuitem DefaultsMenu 17 "&BBS"
  400.                 menuitem DefaultsMenu 18 "&Prompts"
  401.                 menuitem DefaultsMenu 19 "Mail &Door"
  402.         menupopup MailRunMenu "&Add" AddMenu
  403.             menuitem AddMenu 20 "&New BBS"
  404.             menuitem AddMenu 21 "&Get/Send Mail"
  405.             menuitem AddMenu 22 "&Upload File"
  406.             menuitem AddMenu 23 "&Download File"
  407.             menuitem AddMenu 24 "Send &Command"
  408.             menuitem AddMenu 25 "Execute &Script"
  409.         menupopup MailRunMenu "&Execute" ExecuteMenu
  410.             menuitem ExecuteMenu 26 "&Execute MailRun"
  411.              menuitem ExecuteMenu 27 "&QWK Reader"
  412.             menuitem ExecuteMenu 28 "&Archiver"
  413.             menuitem ExecuteMenu 29 "&View Log File"
  414.         menupopup MailRunMenu "&Help" HelpMenu
  415.             menuitem HelpMenu 30 "&Contents"
  416.             menuitem HelpMenu 31 "&On current window..."
  417.             menuitem HelpMenu SEPARATOR
  418.             menuitem HelpMenu 32 "&About MailRun"
  419. endproc
  420.  
  421.  
  422. #comment
  423. *********************************************************************
  424. * RUNMENU()
  425. * Called by main()
  426. * Creates the menu bar used while a mailrun is executing.
  427. *********************************************************************
  428. #endcomment
  429.  
  430. proc runmenu
  431.     menubar RunningMenu
  432.         menupopup RunningMenu "&File" FileMenu
  433.             menuitem FileMenu 1 "&New"
  434.             menuitem FileMenu 2 "&Save"
  435.             menuitem FileMenu 3 "Save &As"
  436.             menuitem FileMenu SEPARATOR
  437.             menuitem FileMenu 4 "&Reset mailrun"
  438.             menuitem FileMenu 5 "&Delete mailrun"
  439.             menuitem FileMenu SEPARATOR
  440.             menuitem FileMenu 6 "&Create AutoRun"
  441.             menuitem FileMenu SEPARATOR
  442.             menuitem FileMenu 7 "E&xit"
  443.         menupopup RunningMenu "&Edit" EditMenu
  444.             menuitem EditMenu 8 "Cu&t"
  445.             menuitem EditMenu 9 "&Copy"
  446.             menuitem EditMenu 10 "&Paste"
  447.             menuitem EditMenu SEPARATOR
  448.             menuitem EditMenu 11 "De&lete"
  449.         menupopup RunningMenu "&Configure" ConfigMenu
  450.             menuitem ConfigMenu 12 "&Mailrun Settings"
  451.             menuitem ConfigMenu 13 "&BBS Settings"
  452.             menuitem ConfigMenu 14 "BBS &Prompts"
  453.             menuitem ConfigMenu 15 "BBS Mail &Door"
  454.             menupopup ConfigMenu "De&faults" DefaultsMenu
  455.                 menuitem DefaultsMenu 16 "&MailRun"
  456.                 menuitem DefaultsMenu 17 "&BBS"
  457.                 menuitem DefaultsMenu 18 "&Prompts"
  458.                 menuitem DefaultsMenu 19 "Mail &Door"
  459.         menupopup RunningMenu "&Add" AddMenu
  460.             menuitem AddMenu 20 "&New BBS"
  461.             menuitem AddMenu 21 "&Get/Send Mail"
  462.             menuitem AddMenu 22 "&Upload File"
  463.             menuitem AddMenu 23 "&Download File"
  464.             menuitem AddMenu 24 "Send &Command"
  465.             menuitem AddMenu 25 "Execute &Script"
  466.         menupopup RunningMenu "&Execute" ExecuteMenu
  467.             menuitem ExecuteMenu 26 "T&erminate MailRun"
  468.              menuitem ExecuteMenu 27 "&QWK Reader"
  469.             menuitem ExecuteMenu 28 "&Archiver"
  470.             menuitem ExecuteMenu 29 "&View Log File"
  471.         menupopup RunningMenu "&Help" HelpMenu
  472.             menuitem HelpMenu 30 "&Contents"
  473.             menuitem HelpMenu 31 "&On current window..."
  474.             menuitem HelpMenu SEPARATOR
  475.             menuitem HelpMenu 32 "&About MailRun"
  476. endproc
  477.  
  478.  
  479. #comment
  480. *********************************************************************
  481. * MRUNWIN()
  482. * Called by main()
  483. * Calls makefullname()
  484. * Creates the MailRun icon bar.  The DLL containing the
  485. * icons is copied to the C: root directory because the
  486. * iconbutton function will not accept variables as file
  487. * names.  C:\ is used because it is fairly certain to exist.
  488. *********************************************************************
  489. #endcomment
  490.  
  491. proc mrunwin
  492. string MRunIcons
  493.     MRunIcons = makefullname(MailRunDir, "MRUNICON.DLL")
  494.     copyfile MRunIcons "C:\MRUNICON.DLL"
  495.     defuserwin TOP PIXELS 34 192 192 192 bitmap
  496.         switch $XPIXELS
  497.             case 1280
  498.                 iconbutton  1   25 0 "" "C:\MRUNICON.DLL"  0 userwin
  499.                 iconbutton  2  300 0 "" "C:\MRUNICON.DLL"  1 userwin
  500.                 iconbutton  3  575 0 "" "C:\MRUNICON.DLL"  2 userwin 
  501.                 iconbutton  4  850 0 "" "C:\MRUNICON.DLL"  3 userwin 
  502.                 iconbutton  5 1250 0 "" "C:\MRUNICON.DLL"  4 userwin
  503.                 iconbutton  6 1525 0 "" "C:\MRUNICON.DLL"  5 userwin
  504.                 iconbutton  7 1800 0 "" "C:\MRUNICON.DLL"  6 userwin
  505.                 iconbutton  8 2075 0 "" "C:\MRUNICON.DLL"  7 userwin
  506.                 iconbutton  9 2350 0 "" "C:\MRUNICON.DLL"  8 userwin 
  507.                 iconbutton 10 2625 0 "" "C:\MRUNICON.DLL"  9 userwin
  508.                 iconbutton 11 2900 0 "" "C:\MRUNICON.DLL" 10 userwin
  509.                 iconbutton 12 3300 0 "" "C:\MRUNICON.DLL" 11 userwin
  510.                 iconbutton 13 3575 0 "" "C:\MRUNICON.DLL" 12 userwin
  511.                 iconbutton 14 3850 0 "" "C:\MRUNICON.DLL" 13 userwin
  512.                 iconbutton 15 4250 0 "" "C:\MRUNICON.DLL" 14 userwin
  513.                 iconbutton 16 4650 0 "" "C:\MRUNICON.DLL" 15 userwin
  514.             endcase
  515.             case 1024
  516.                 iconbutton  1   30 0 "" "C:\MRUNICON.DLL"  0 userwin
  517.                 iconbutton  2  374 0 "" "C:\MRUNICON.DLL"  1 userwin
  518.                 iconbutton  3  718 0 "" "C:\MRUNICON.DLL"  2 userwin 
  519.                 iconbutton  4 1062 0 "" "C:\MRUNICON.DLL"  3 userwin 
  520.                 iconbutton  5 1562 0 "" "C:\MRUNICON.DLL"  4 userwin
  521.                 iconbutton  6 1906 0 "" "C:\MRUNICON.DLL"  5 userwin
  522.                 iconbutton  7 2250 0 "" "C:\MRUNICON.DLL"  6 userwin
  523.                 iconbutton  8 2594 0 "" "C:\MRUNICON.DLL"  7 userwin
  524.                 iconbutton  9 2938 0 "" "C:\MRUNICON.DLL"  8 userwin 
  525.                 iconbutton 10 3282 0 "" "C:\MRUNICON.DLL"  9 userwin
  526.                 iconbutton 11 3626 0 "" "C:\MRUNICON.DLL" 10 userwin
  527.                 iconbutton 12 4126 0 "" "C:\MRUNICON.DLL" 11 userwin
  528.                 iconbutton 13 4470 0 "" "C:\MRUNICON.DLL" 12 userwin
  529.                 iconbutton 14 4814 0 "" "C:\MRUNICON.DLL" 13 userwin
  530.                 iconbutton 15 5314 0 "" "C:\MRUNICON.DLL" 14 userwin
  531.                 iconbutton 16 5814 0 "" "C:\MRUNICON.DLL" 15 userwin
  532.             endcase
  533.             case 800
  534.                 iconbutton  1   40 0 "" "C:\MRUNICON.DLL"  0 userwin
  535.                 iconbutton  2  480 0 "" "C:\MRUNICON.DLL"  1 userwin
  536.                 iconbutton  3  920 0 "" "C:\MRUNICON.DLL"  2 userwin 
  537.                 iconbutton  4 1360 0 "" "C:\MRUNICON.DLL"  3 userwin
  538.                 iconbutton  5 2000 0 "" "C:\MRUNICON.DLL"  4 userwin
  539.                 iconbutton  6 2440 0 "" "C:\MRUNICON.DLL"  5 userwin
  540.                 iconbutton  7 2880 0 "" "C:\MRUNICON.DLL"  6 userwin
  541.                 iconbutton  8 3320 0 "" "C:\MRUNICON.DLL"  7 userwin
  542.                 iconbutton  9 3760 0 "" "C:\MRUNICON.DLL"  8 userwin 
  543.                 iconbutton 10 4200 0 "" "C:\MRUNICON.DLL"  9 userwin
  544.                 iconbutton 11 4640 0 "" "C:\MRUNICON.DLL" 10 userwin
  545.                 iconbutton 12 5280 0 "" "C:\MRUNICON.DLL" 11 userwin 
  546.                 iconbutton 13 5720 0 "" "C:\MRUNICON.DLL" 12 userwin 
  547.                 iconbutton 14 6160 0 "" "C:\MRUNICON.DLL" 13 userwin 
  548.                 iconbutton 15 6800 0 "" "C:\MRUNICON.DLL" 14 userwin 
  549.                 iconbutton 16 7440 0 "" "C:\MRUNICON.DLL" 15 userwin 
  550.             endcase
  551.             default
  552.                 iconbutton  1   50 0 "" "C:\MRUNICON.DLL"  0 userwin
  553.                 iconbutton  2  600 0 "" "C:\MRUNICON.DLL"  1 userwin
  554.                 iconbutton  3 1150 0 "" "C:\MRUNICON.DLL"  2 userwin
  555.                 iconbutton  4 1700 0 "" "C:\MRUNICON.DLL"  3 userwin
  556.                 iconbutton  5 2500 0 "" "C:\MRUNICON.DLL"  4 userwin
  557.                 iconbutton  6 3050 0 "" "C:\MRUNICON.DLL"  5 userwin 
  558.                 iconbutton  7 3600 0 "" "C:\MRUNICON.DLL"  6 userwin 
  559.                 iconbutton  8 4150 0 "" "C:\MRUNICON.DLL"  7 userwin 
  560.                 iconbutton  9 4700 0 "" "C:\MRUNICON.DLL"  8 userwin 
  561.                 iconbutton 10 5250 0 "" "C:\MRUNICON.DLL"  9 userwin
  562.                 iconbutton 11 5800 0 "" "C:\MRUNICON.DLL" 10 userwin
  563.                 iconbutton 12 6600 0 "" "C:\MRUNICON.DLL" 11 userwin 
  564.                 iconbutton 13 7150 0 "" "C:\MRUNICON.DLL" 12 userwin
  565.                 iconbutton 14 7700 0 "" "C:\MRUNICON.DLL" 13 userwin 
  566.                 iconbutton 15 8500 0 "" "C:\MRUNICON.DLL" 14 userwin 
  567.                 iconbutton 16 9300 0 "" "C:\MRUNICON.DLL" 15 userwin
  568.             endcase
  569.         endswitch
  570.     paint
  571.     delfile "C:\MRUNICON.DLL"
  572. endproc
  573.  
  574.  
  575. #comment
  576. *********************************************************************
  577. * MAILRUNBOX()
  578. * Called by main(), parsedialog(), callscript(), executor(),
  579. * sendscript()
  580. * Draws the main MailRun dialog box.
  581. *********************************************************************
  582. #endcomment
  583.  
  584. proc mailrunbox
  585. destroydlg
  586. MainBoxTabs = "20,30,220,230,233,236,239,242"
  587. AttemptNum = "0"
  588. HelpPage = 1
  589. dialogbox 8 36 346 181 15 "MailRun" HELPID HelpPage
  590.    groupbox 10 33 228 135 "Task List" shadow
  591.    flistbox 15 52 218 102 TaskList MainBoxTabs single TaskItem
  592.    text  15 153 49 8 left "# = permanent"
  593.    text  76 153 49 8 left "ñ = temporary"
  594.    text  140 153 33 8 left "! = error"
  595.    text  182 153 53 8 left "@ = completed"
  596.    groupbox 244 33 90 135 "Statistics" shadow
  597.    text  248 55 62 8 right "BBSs in mailrun:"
  598.    text  248 69 62 8 right "BBSs completed:"
  599.    text  248 83 62 8 right "BBSs left to call:"
  600.    text  248 97 62 8 right "Items in mailrun:"
  601.    text  248 111 62 8 right "Items completed:"
  602.    text  248 125 62 8 right "Item errors:"
  603.    text  248 139 62 8 right "Items remaining:"
  604.    text  248 153 62 8 right "Dialing Attempt:"
  605.    vtext 314 55 16 9 left BBSTotal
  606.    vtext 314 69 16 9 left BBSComplete
  607.    vtext 314 83 16 9 left BBSRemaining
  608.    vtext 314 97 16 9 left ItemTotal
  609.    vtext 314 111 16 9 left ItemComplete
  610.    vtext 314 125 16 9 left ItemError
  611.    vtext 314 139 16 9 left ItemRemaining
  612.    vtext 314 153 16 9 left AttemptNum
  613.    text  102 14 74 8 right "The current mailrun is:"
  614.    combobox 180 12 76 41 MailRunList MailRunTrunc sort
  615.    pushbutton 0 0 0 0 "          &t" normal default
  616.    pushbutton 0 0 0 0 "          &u" normal
  617.    pushbutton 0 0 0 0 "          &i" normal
  618. enddialog
  619. if FLAGS & RUNNING
  620.     disable CTRL 170
  621. endif
  622. endproc
  623.  
  624.  
  625. #comment
  626. *********************************************************************
  627. * SCHEDULEBOX()
  628. * Called by executor()
  629. * Draws the MailRun Scheduler dialog box.
  630. *********************************************************************
  631. #endcomment
  632.  
  633. proc schedulebox
  634. destroydlg
  635. HelpPage = 3
  636. dialogbox 55 58 238 120 15 "MailRun Scheduler" HELPID HelpPage
  637.    groupbox 10 14 122 67 "Schedule" shadow
  638.    radiobutton 21 28 90 10 "Execute MailRun Now!" GoWait
  639.    radiobutton 21 44 90 10 "Execute MailRun Later..." endgroup
  640.    text  17 62 43 8 right "Execute At:"
  641.    editbox 64 60 55 12 ExecTime 8
  642.    groupbox 142 14 80 67 "When finished... " shadow
  643.    radiobutton 152 28 60 10 "Remain Idle" PostRun
  644.    radiobutton 152 44 60 10 "Restart" 
  645.    radiobutton 152 60 60 10 "Shut Down" endgroup
  646.    checkbox 10 92 116 12 "Interrupt mailrun if phone rings" RingInterrupt
  647.    pushbutton 132 93 40 14 "&OK" normal default
  648.    pushbutton 182 93 40 14 "&Cancel" cancel
  649. enddialog
  650. endproc
  651.  
  652.  
  653.